export class Msg {
    fromUserId: string;     // 发送者用户 ID
    toUserId: string;       // 接收者用户 ID
    username: string;       // 发送者用户名
    avatar: string;         // 发送者头像
    content: string;        // 消息内容
    timestamp: Date;        // 消息时间戳（新增字段）
    constructor(fromUserId: string, toUserId: string, username: string, avatar: string, content: string, timestamp?: Date) {
        this.fromUserId = fromUserId;
        this.toUserId = toUserId;
        this.username = username;
        this.avatar = avatar;
        this.content = content;
        this.timestamp = timestamp || new Date();
    }
}